<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box h2,
        h2+p {
            margin-top: 20px;
            line-height: 20px;
            text-align: center;
        }

        .box .list .one {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 30px 20px;
        }

        .box .list .one img {
            width: 60px;
        }

        .box .list .one button:nth-child(3) {
            background-color: aqua;
        }
    </style>
</head>

<body>
    <div class="box" id="app">
        <h2>任务列表</h2>
        <p>每完成一个任务，即可获得<span>10MB~1GB</span>流量哦</p>
        <div class="list">
            <div class="one" v-for="(item,index) in tasklist" v-bind:key="index">
                <img v-bind:src="item.pic" alt="">
                <div class="zhong">
                    <h3 class="name">{{item.name}}</h3>
                    <p class="xuanchuan">{{item.xuanchuan}}</p>
                </div>
                <button> {{ item.but == 1 ? '去完成' : (item.but == 2 ? '领取' : '已领取') }} </button>
            </div>
        </div>
    </div>
</body>

</html>
<script src="./js/vue-2.5.21.js"></script>
<script>
    var v = new Vue({
        el: '#app',
        data: {
            tasklist: [
                { id: '1', pic: './img/pic1.png', name: '咪咕视频送流量', xuanchuan: '每月500MB流量奖励', but: '1' },
                { id: '1', pic: './img/pic2.png', name: '咪咕视频送福利', xuanchuan: '11.6送1000MB流量奖励', but: '2' },
                { id: '1', pic: './img/pic3.png', name: '咪咕视频送套餐折扣券', xuanchuan: '11.8送5000MB流量奖励', but: '3' },
                { id: '1', pic: './img/pic4.png', name: '咪咕视频送超级秒杀', xuanchuan: '12.1送2000MB流量奖励', but: '1' }
            ]
        }
    })
</script>